package com.wn.common.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.launcher.ARouter
import com.wn.common.constant.SEARCH_SERVICE_SEARCH
import com.wn.common.service.ISearchService

/**
 * @Author: wn
 * @Date: 2024/12/10 16:44
 * @Description: SearchService提供类，对外提供相关能力
 */
object SearchServiceProvider {

  @Autowired(name = SEARCH_SERVICE_SEARCH)
  lateinit var searchService: ISearchService

  init {
    ARouter.getInstance().inject(this)
  }

  /**
   * 跳转搜索页
   * @param context
   */
  fun toSearch(context: Context) {
    searchService.toSearch(context)
  }

  /**
   * 清除搜索历史缓存
   */
  fun clearSearchHistoryCache() {
    searchService.clearSearchHistoryCache()
  }
}